#!/bin/bash

# Start tmux session in detached mode
tmux new-session -d -s myproject

# Split the window vertically
tmux split-window -v

# Start the frontend in the top pane
tmux send-keys -t myproject:0.0 "cd web/ && npm run dev" C-m

# Start the backend in the bottom pane
tmux send-keys -t myproject:0.1 "cd api && poetry run python -m flask run --host 0.0.0.0 --port=5001 --debug" C-m

# Attach to the tmux session
tmux attach-session -t myproject
